use mtdb
GO

/* drop/create OBJ_REF */
DROP TABLE OBJ_REF
GO

CREATE TABLE OBJ_REF
(
    TENANT_ID NUMERIC(7,0) NOT NULL,
    OBJ_DEF_ID VARCHAR(128) NOT NULL,
    REF_DEF_ID VARCHAR(128) NOT NULL,
    OBJ_ID VARCHAR(64) NOT NULL,
    OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL,
    TARGET_OBJ_DEF_ID VARCHAR(128) NOT NULL,
    TARGET_OBJ_ID VARCHAR(64) NOT NULL,
    TARGET_OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL
)
GO

CREATE INDEX OBJ_REF_INDEX1 ON OBJ_REF (TENANT_ID, OBJ_DEF_ID, OBJ_ID, REF_DEF_ID)
GO
CREATE INDEX OBJ_REF_INDEX2 ON OBJ_REF (TENANT_ID, TARGET_OBJ_DEF_ID, TARGET_OBJ_ID, REF_DEF_ID)
GO

/* drop/create OBJ_REF */
DROP TABLE OBJ_REF__1
GO

CREATE TABLE OBJ_REF__1
(
    TENANT_ID NUMERIC(7,0) NOT NULL,
    OBJ_DEF_ID VARCHAR(128) NOT NULL,
    REF_DEF_ID VARCHAR(128) NOT NULL,
    OBJ_ID VARCHAR(64) NOT NULL,
    OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL,
    TARGET_OBJ_DEF_ID VARCHAR(128) NOT NULL,
    TARGET_OBJ_ID VARCHAR(64) NOT NULL,
    TARGET_OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL
)
GO

CREATE INDEX OBJ_REF__1_INDEX1 ON OBJ_REF__1 (TENANT_ID, OBJ_DEF_ID, OBJ_ID, REF_DEF_ID)
GO
CREATE INDEX OBJ_REF__1_INDEX2 ON OBJ_REF__1 (TENANT_ID, TARGET_OBJ_DEF_ID, TARGET_OBJ_ID, REF_DEF_ID)
GO

/* drop/create OBJ_REF */
DROP TABLE OBJ_REF__2
GO

CREATE TABLE OBJ_REF__2
(
    TENANT_ID NUMERIC(7,0) NOT NULL,
    OBJ_DEF_ID VARCHAR(128) NOT NULL,
    REF_DEF_ID VARCHAR(128) NOT NULL,
    OBJ_ID VARCHAR(64) NOT NULL,
    OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL,
    TARGET_OBJ_DEF_ID VARCHAR(128) NOT NULL,
    TARGET_OBJ_ID VARCHAR(64) NOT NULL,
    TARGET_OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL
)
GO

CREATE INDEX OBJ_REF__2_INDEX1 ON OBJ_REF__2 (TENANT_ID, OBJ_DEF_ID, OBJ_ID, REF_DEF_ID)
GO
CREATE INDEX OBJ_REF__2_INDEX2 ON OBJ_REF__2 (TENANT_ID, TARGET_OBJ_DEF_ID, TARGET_OBJ_ID, REF_DEF_ID)
GO

/* drop/create OBJ_REF */
DROP TABLE OBJ_REF__3
GO

CREATE TABLE OBJ_REF__3
(
    TENANT_ID NUMERIC(7,0) NOT NULL,
    OBJ_DEF_ID VARCHAR(128) NOT NULL,
    REF_DEF_ID VARCHAR(128) NOT NULL,
    OBJ_ID VARCHAR(64) NOT NULL,
    OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL,
    TARGET_OBJ_DEF_ID VARCHAR(128) NOT NULL,
    TARGET_OBJ_ID VARCHAR(64) NOT NULL,
    TARGET_OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL
)
GO

CREATE INDEX OBJ_REF__3_INDEX1 ON OBJ_REF__3 (TENANT_ID, OBJ_DEF_ID, OBJ_ID, REF_DEF_ID)
GO
CREATE INDEX OBJ_REF__3_INDEX2 ON OBJ_REF__3 (TENANT_ID, TARGET_OBJ_DEF_ID, TARGET_OBJ_ID, REF_DEF_ID)
GO

/* drop/create OBJ_REF */
DROP TABLE OBJ_REF__4
GO

CREATE TABLE OBJ_REF__4
(
    TENANT_ID NUMERIC(7,0) NOT NULL,
    OBJ_DEF_ID VARCHAR(128) NOT NULL,
    REF_DEF_ID VARCHAR(128) NOT NULL,
    OBJ_ID VARCHAR(64) NOT NULL,
    OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL,
    TARGET_OBJ_DEF_ID VARCHAR(128) NOT NULL,
    TARGET_OBJ_ID VARCHAR(64) NOT NULL,
    TARGET_OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL
)
GO

CREATE INDEX OBJ_REF__4_INDEX1 ON OBJ_REF__4 (TENANT_ID, OBJ_DEF_ID, OBJ_ID, REF_DEF_ID)
GO
CREATE INDEX OBJ_REF__4_INDEX2 ON OBJ_REF__4 (TENANT_ID, TARGET_OBJ_DEF_ID, TARGET_OBJ_ID, REF_DEF_ID)
GO

/* drop/create OBJ_REF */
DROP TABLE OBJ_REF__5
GO

CREATE TABLE OBJ_REF__5
(
    TENANT_ID NUMERIC(7,0) NOT NULL,
    OBJ_DEF_ID VARCHAR(128) NOT NULL,
    REF_DEF_ID VARCHAR(128) NOT NULL,
    OBJ_ID VARCHAR(64) NOT NULL,
    OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL,
    TARGET_OBJ_DEF_ID VARCHAR(128) NOT NULL,
    TARGET_OBJ_ID VARCHAR(64) NOT NULL,
    TARGET_OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL
)
GO

CREATE INDEX OBJ_REF__5_INDEX1 ON OBJ_REF__5 (TENANT_ID, OBJ_DEF_ID, OBJ_ID, REF_DEF_ID)
GO
CREATE INDEX OBJ_REF__5_INDEX2 ON OBJ_REF__5 (TENANT_ID, TARGET_OBJ_DEF_ID, TARGET_OBJ_ID, REF_DEF_ID)
GO

/* drop/create OBJ_REF */
DROP TABLE OBJ_REF__6
GO

CREATE TABLE OBJ_REF__6
(
    TENANT_ID NUMERIC(7,0) NOT NULL,
    OBJ_DEF_ID VARCHAR(128) NOT NULL,
    REF_DEF_ID VARCHAR(128) NOT NULL,
    OBJ_ID VARCHAR(64) NOT NULL,
    OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL,
    TARGET_OBJ_DEF_ID VARCHAR(128) NOT NULL,
    TARGET_OBJ_ID VARCHAR(64) NOT NULL,
    TARGET_OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL
)
GO

CREATE INDEX OBJ_REF__6_INDEX1 ON OBJ_REF__6 (TENANT_ID, OBJ_DEF_ID, OBJ_ID, REF_DEF_ID)
GO
CREATE INDEX OBJ_REF__6_INDEX2 ON OBJ_REF__6 (TENANT_ID, TARGET_OBJ_DEF_ID, TARGET_OBJ_ID, REF_DEF_ID)
GO

/* drop/create OBJ_REF */
DROP TABLE OBJ_REF__7
GO

CREATE TABLE OBJ_REF__7
(
    TENANT_ID NUMERIC(7,0) NOT NULL,
    OBJ_DEF_ID VARCHAR(128) NOT NULL,
    REF_DEF_ID VARCHAR(128) NOT NULL,
    OBJ_ID VARCHAR(64) NOT NULL,
    OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL,
    TARGET_OBJ_DEF_ID VARCHAR(128) NOT NULL,
    TARGET_OBJ_ID VARCHAR(64) NOT NULL,
    TARGET_OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL
)
GO

CREATE INDEX OBJ_REF__7_INDEX1 ON OBJ_REF__7 (TENANT_ID, OBJ_DEF_ID, OBJ_ID, REF_DEF_ID)
GO
CREATE INDEX OBJ_REF__7_INDEX2 ON OBJ_REF__7 (TENANT_ID, TARGET_OBJ_DEF_ID, TARGET_OBJ_ID, REF_DEF_ID)
GO

/* drop/create OBJ_REF */
DROP TABLE OBJ_REF__8
GO

CREATE TABLE OBJ_REF__8
(
    TENANT_ID NUMERIC(7,0) NOT NULL,
    OBJ_DEF_ID VARCHAR(128) NOT NULL,
    REF_DEF_ID VARCHAR(128) NOT NULL,
    OBJ_ID VARCHAR(64) NOT NULL,
    OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL,
    TARGET_OBJ_DEF_ID VARCHAR(128) NOT NULL,
    TARGET_OBJ_ID VARCHAR(64) NOT NULL,
    TARGET_OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL
)
GO

CREATE INDEX OBJ_REF__8_INDEX1 ON OBJ_REF__8 (TENANT_ID, OBJ_DEF_ID, OBJ_ID, REF_DEF_ID)
GO
CREATE INDEX OBJ_REF__8_INDEX2 ON OBJ_REF__8 (TENANT_ID, TARGET_OBJ_DEF_ID, TARGET_OBJ_ID, REF_DEF_ID)
GO

/* drop/create OBJ_REF */
DROP TABLE OBJ_REF__9
GO

CREATE TABLE OBJ_REF__9
(
    TENANT_ID NUMERIC(7,0) NOT NULL,
    OBJ_DEF_ID VARCHAR(128) NOT NULL,
    REF_DEF_ID VARCHAR(128) NOT NULL,
    OBJ_ID VARCHAR(64) NOT NULL,
    OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL,
    TARGET_OBJ_DEF_ID VARCHAR(128) NOT NULL,
    TARGET_OBJ_ID VARCHAR(64) NOT NULL,
    TARGET_OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL
)
GO

CREATE INDEX OBJ_REF__9_INDEX1 ON OBJ_REF__9 (TENANT_ID, OBJ_DEF_ID, OBJ_ID, REF_DEF_ID)
GO
CREATE INDEX OBJ_REF__9_INDEX2 ON OBJ_REF__9 (TENANT_ID, TARGET_OBJ_DEF_ID, TARGET_OBJ_ID, REF_DEF_ID)
GO

/* drop/create OBJ_REF */
DROP TABLE OBJ_REF__10
GO

CREATE TABLE OBJ_REF__10
(
    TENANT_ID NUMERIC(7,0) NOT NULL,
    OBJ_DEF_ID VARCHAR(128) NOT NULL,
    REF_DEF_ID VARCHAR(128) NOT NULL,
    OBJ_ID VARCHAR(64) NOT NULL,
    OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL,
    TARGET_OBJ_DEF_ID VARCHAR(128) NOT NULL,
    TARGET_OBJ_ID VARCHAR(64) NOT NULL,
    TARGET_OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL
)
GO

CREATE INDEX OBJ_REF__10_INDEX1 ON OBJ_REF__10 (TENANT_ID, OBJ_DEF_ID, OBJ_ID, REF_DEF_ID)
GO
CREATE INDEX OBJ_REF__10_INDEX2 ON OBJ_REF__10 (TENANT_ID, TARGET_OBJ_DEF_ID, TARGET_OBJ_ID, REF_DEF_ID)
GO

/* drop/create OBJ_REF */
DROP TABLE OBJ_REF__11
GO

CREATE TABLE OBJ_REF__11
(
    TENANT_ID NUMERIC(7,0) NOT NULL,
    OBJ_DEF_ID VARCHAR(128) NOT NULL,
    REF_DEF_ID VARCHAR(128) NOT NULL,
    OBJ_ID VARCHAR(64) NOT NULL,
    OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL,
    TARGET_OBJ_DEF_ID VARCHAR(128) NOT NULL,
    TARGET_OBJ_ID VARCHAR(64) NOT NULL,
    TARGET_OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL
)
GO

CREATE INDEX OBJ_REF__11_INDEX1 ON OBJ_REF__11 (TENANT_ID, OBJ_DEF_ID, OBJ_ID, REF_DEF_ID)
GO
CREATE INDEX OBJ_REF__11_INDEX2 ON OBJ_REF__11 (TENANT_ID, TARGET_OBJ_DEF_ID, TARGET_OBJ_ID, REF_DEF_ID)
GO

/* drop/create OBJ_REF */
DROP TABLE OBJ_REF__12
GO

CREATE TABLE OBJ_REF__12
(
    TENANT_ID NUMERIC(7,0) NOT NULL,
    OBJ_DEF_ID VARCHAR(128) NOT NULL,
    REF_DEF_ID VARCHAR(128) NOT NULL,
    OBJ_ID VARCHAR(64) NOT NULL,
    OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL,
    TARGET_OBJ_DEF_ID VARCHAR(128) NOT NULL,
    TARGET_OBJ_ID VARCHAR(64) NOT NULL,
    TARGET_OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL
)
GO

CREATE INDEX OBJ_REF__12_INDEX1 ON OBJ_REF__12 (TENANT_ID, OBJ_DEF_ID, OBJ_ID, REF_DEF_ID)
GO
CREATE INDEX OBJ_REF__12_INDEX2 ON OBJ_REF__12 (TENANT_ID, TARGET_OBJ_DEF_ID, TARGET_OBJ_ID, REF_DEF_ID)
GO

/* drop/create OBJ_REF */
DROP TABLE OBJ_REF__13
GO

CREATE TABLE OBJ_REF__13
(
    TENANT_ID NUMERIC(7,0) NOT NULL,
    OBJ_DEF_ID VARCHAR(128) NOT NULL,
    REF_DEF_ID VARCHAR(128) NOT NULL,
    OBJ_ID VARCHAR(64) NOT NULL,
    OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL,
    TARGET_OBJ_DEF_ID VARCHAR(128) NOT NULL,
    TARGET_OBJ_ID VARCHAR(64) NOT NULL,
    TARGET_OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL
)
GO

CREATE INDEX OBJ_REF__13_INDEX1 ON OBJ_REF__13 (TENANT_ID, OBJ_DEF_ID, OBJ_ID, REF_DEF_ID)
GO
CREATE INDEX OBJ_REF__13_INDEX2 ON OBJ_REF__13 (TENANT_ID, TARGET_OBJ_DEF_ID, TARGET_OBJ_ID, REF_DEF_ID)
GO

/* drop/create OBJ_REF */
DROP TABLE OBJ_REF__14
GO

CREATE TABLE OBJ_REF__14
(
    TENANT_ID NUMERIC(7,0) NOT NULL,
    OBJ_DEF_ID VARCHAR(128) NOT NULL,
    REF_DEF_ID VARCHAR(128) NOT NULL,
    OBJ_ID VARCHAR(64) NOT NULL,
    OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL,
    TARGET_OBJ_DEF_ID VARCHAR(128) NOT NULL,
    TARGET_OBJ_ID VARCHAR(64) NOT NULL,
    TARGET_OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL
)
GO

CREATE INDEX OBJ_REF__14_INDEX1 ON OBJ_REF__14 (TENANT_ID, OBJ_DEF_ID, OBJ_ID, REF_DEF_ID)
GO
CREATE INDEX OBJ_REF__14_INDEX2 ON OBJ_REF__14 (TENANT_ID, TARGET_OBJ_DEF_ID, TARGET_OBJ_ID, REF_DEF_ID)
GO

/* drop/create OBJ_REF */
DROP TABLE OBJ_REF__15
GO

CREATE TABLE OBJ_REF__15
(
    TENANT_ID NUMERIC(7,0) NOT NULL,
    OBJ_DEF_ID VARCHAR(128) NOT NULL,
    REF_DEF_ID VARCHAR(128) NOT NULL,
    OBJ_ID VARCHAR(64) NOT NULL,
    OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL,
    TARGET_OBJ_DEF_ID VARCHAR(128) NOT NULL,
    TARGET_OBJ_ID VARCHAR(64) NOT NULL,
    TARGET_OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL
)
GO

CREATE INDEX OBJ_REF__15_INDEX1 ON OBJ_REF__15 (TENANT_ID, OBJ_DEF_ID, OBJ_ID, REF_DEF_ID)
GO
CREATE INDEX OBJ_REF__15_INDEX2 ON OBJ_REF__15 (TENANT_ID, TARGET_OBJ_DEF_ID, TARGET_OBJ_ID, REF_DEF_ID)
GO

/* drop/create OBJ_REF */
DROP TABLE OBJ_REF__16
GO

CREATE TABLE OBJ_REF__16
(
    TENANT_ID NUMERIC(7,0) NOT NULL,
    OBJ_DEF_ID VARCHAR(128) NOT NULL,
    REF_DEF_ID VARCHAR(128) NOT NULL,
    OBJ_ID VARCHAR(64) NOT NULL,
    OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL,
    TARGET_OBJ_DEF_ID VARCHAR(128) NOT NULL,
    TARGET_OBJ_ID VARCHAR(64) NOT NULL,
    TARGET_OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL
)
GO

CREATE INDEX OBJ_REF__16_INDEX1 ON OBJ_REF__16 (TENANT_ID, OBJ_DEF_ID, OBJ_ID, REF_DEF_ID)
GO
CREATE INDEX OBJ_REF__16_INDEX2 ON OBJ_REF__16 (TENANT_ID, TARGET_OBJ_DEF_ID, TARGET_OBJ_ID, REF_DEF_ID)
GO

/* drop/create OBJ_REF */
DROP TABLE OBJ_REF__17
GO

CREATE TABLE OBJ_REF__17
(
    TENANT_ID NUMERIC(7,0) NOT NULL,
    OBJ_DEF_ID VARCHAR(128) NOT NULL,
    REF_DEF_ID VARCHAR(128) NOT NULL,
    OBJ_ID VARCHAR(64) NOT NULL,
    OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL,
    TARGET_OBJ_DEF_ID VARCHAR(128) NOT NULL,
    TARGET_OBJ_ID VARCHAR(64) NOT NULL,
    TARGET_OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL
)
GO

CREATE INDEX OBJ_REF__17_INDEX1 ON OBJ_REF__17 (TENANT_ID, OBJ_DEF_ID, OBJ_ID, REF_DEF_ID)
GO
CREATE INDEX OBJ_REF__17_INDEX2 ON OBJ_REF__17 (TENANT_ID, TARGET_OBJ_DEF_ID, TARGET_OBJ_ID, REF_DEF_ID)
GO

/* drop/create OBJ_REF */
DROP TABLE OBJ_REF__18
GO

CREATE TABLE OBJ_REF__18
(
    TENANT_ID NUMERIC(7,0) NOT NULL,
    OBJ_DEF_ID VARCHAR(128) NOT NULL,
    REF_DEF_ID VARCHAR(128) NOT NULL,
    OBJ_ID VARCHAR(64) NOT NULL,
    OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL,
    TARGET_OBJ_DEF_ID VARCHAR(128) NOT NULL,
    TARGET_OBJ_ID VARCHAR(64) NOT NULL,
    TARGET_OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL
)
GO

CREATE INDEX OBJ_REF__18_INDEX1 ON OBJ_REF__18 (TENANT_ID, OBJ_DEF_ID, OBJ_ID, REF_DEF_ID)
GO
CREATE INDEX OBJ_REF__18_INDEX2 ON OBJ_REF__18 (TENANT_ID, TARGET_OBJ_DEF_ID, TARGET_OBJ_ID, REF_DEF_ID)
GO

/* drop/create OBJ_REF */
DROP TABLE OBJ_REF__19
GO

CREATE TABLE OBJ_REF__19
(
    TENANT_ID NUMERIC(7,0) NOT NULL,
    OBJ_DEF_ID VARCHAR(128) NOT NULL,
    REF_DEF_ID VARCHAR(128) NOT NULL,
    OBJ_ID VARCHAR(64) NOT NULL,
    OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL,
    TARGET_OBJ_DEF_ID VARCHAR(128) NOT NULL,
    TARGET_OBJ_ID VARCHAR(64) NOT NULL,
    TARGET_OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL
)
GO

CREATE INDEX OBJ_REF__19_INDEX1 ON OBJ_REF__19 (TENANT_ID, OBJ_DEF_ID, OBJ_ID, REF_DEF_ID)
GO
CREATE INDEX OBJ_REF__19_INDEX2 ON OBJ_REF__19 (TENANT_ID, TARGET_OBJ_DEF_ID, TARGET_OBJ_ID, REF_DEF_ID)
GO

/* drop/create OBJ_REF */
DROP TABLE OBJ_REF__20
GO

CREATE TABLE OBJ_REF__20
(
    TENANT_ID NUMERIC(7,0) NOT NULL,
    OBJ_DEF_ID VARCHAR(128) NOT NULL,
    REF_DEF_ID VARCHAR(128) NOT NULL,
    OBJ_ID VARCHAR(64) NOT NULL,
    OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL,
    TARGET_OBJ_DEF_ID VARCHAR(128) NOT NULL,
    TARGET_OBJ_ID VARCHAR(64) NOT NULL,
    TARGET_OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL
)
GO

CREATE INDEX OBJ_REF__20_INDEX1 ON OBJ_REF__20 (TENANT_ID, OBJ_DEF_ID, OBJ_ID, REF_DEF_ID)
GO
CREATE INDEX OBJ_REF__20_INDEX2 ON OBJ_REF__20 (TENANT_ID, TARGET_OBJ_DEF_ID, TARGET_OBJ_ID, REF_DEF_ID)
GO

/* drop/create OBJ_REF */
DROP TABLE OBJ_REF__21
GO

CREATE TABLE OBJ_REF__21
(
    TENANT_ID NUMERIC(7,0) NOT NULL,
    OBJ_DEF_ID VARCHAR(128) NOT NULL,
    REF_DEF_ID VARCHAR(128) NOT NULL,
    OBJ_ID VARCHAR(64) NOT NULL,
    OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL,
    TARGET_OBJ_DEF_ID VARCHAR(128) NOT NULL,
    TARGET_OBJ_ID VARCHAR(64) NOT NULL,
    TARGET_OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL
)
GO

CREATE INDEX OBJ_REF__21_INDEX1 ON OBJ_REF__21 (TENANT_ID, OBJ_DEF_ID, OBJ_ID, REF_DEF_ID)
GO
CREATE INDEX OBJ_REF__21_INDEX2 ON OBJ_REF__21 (TENANT_ID, TARGET_OBJ_DEF_ID, TARGET_OBJ_ID, REF_DEF_ID)
GO

/* drop/create OBJ_REF */
DROP TABLE OBJ_REF__22
GO

CREATE TABLE OBJ_REF__22
(
    TENANT_ID NUMERIC(7,0) NOT NULL,
    OBJ_DEF_ID VARCHAR(128) NOT NULL,
    REF_DEF_ID VARCHAR(128) NOT NULL,
    OBJ_ID VARCHAR(64) NOT NULL,
    OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL,
    TARGET_OBJ_DEF_ID VARCHAR(128) NOT NULL,
    TARGET_OBJ_ID VARCHAR(64) NOT NULL,
    TARGET_OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL
)
GO

CREATE INDEX OBJ_REF__22_INDEX1 ON OBJ_REF__22 (TENANT_ID, OBJ_DEF_ID, OBJ_ID, REF_DEF_ID)
GO
CREATE INDEX OBJ_REF__22_INDEX2 ON OBJ_REF__22 (TENANT_ID, TARGET_OBJ_DEF_ID, TARGET_OBJ_ID, REF_DEF_ID)
GO

/* drop/create OBJ_REF */
DROP TABLE OBJ_REF__23
GO

CREATE TABLE OBJ_REF__23
(
    TENANT_ID NUMERIC(7,0) NOT NULL,
    OBJ_DEF_ID VARCHAR(128) NOT NULL,
    REF_DEF_ID VARCHAR(128) NOT NULL,
    OBJ_ID VARCHAR(64) NOT NULL,
    OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL,
    TARGET_OBJ_DEF_ID VARCHAR(128) NOT NULL,
    TARGET_OBJ_ID VARCHAR(64) NOT NULL,
    TARGET_OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL
)
GO

CREATE INDEX OBJ_REF__23_INDEX1 ON OBJ_REF__23 (TENANT_ID, OBJ_DEF_ID, OBJ_ID, REF_DEF_ID)
GO
CREATE INDEX OBJ_REF__23_INDEX2 ON OBJ_REF__23 (TENANT_ID, TARGET_OBJ_DEF_ID, TARGET_OBJ_ID, REF_DEF_ID)
GO

/* drop/create OBJ_REF */
DROP TABLE OBJ_REF__24
GO

CREATE TABLE OBJ_REF__24
(
    TENANT_ID NUMERIC(7,0) NOT NULL,
    OBJ_DEF_ID VARCHAR(128) NOT NULL,
    REF_DEF_ID VARCHAR(128) NOT NULL,
    OBJ_ID VARCHAR(64) NOT NULL,
    OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL,
    TARGET_OBJ_DEF_ID VARCHAR(128) NOT NULL,
    TARGET_OBJ_ID VARCHAR(64) NOT NULL,
    TARGET_OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL
)
GO

CREATE INDEX OBJ_REF__24_INDEX1 ON OBJ_REF__24 (TENANT_ID, OBJ_DEF_ID, OBJ_ID, REF_DEF_ID)
GO
CREATE INDEX OBJ_REF__24_INDEX2 ON OBJ_REF__24 (TENANT_ID, TARGET_OBJ_DEF_ID, TARGET_OBJ_ID, REF_DEF_ID)
GO

/* drop/create OBJ_REF */
DROP TABLE OBJ_REF__25
GO

CREATE TABLE OBJ_REF__25
(
    TENANT_ID NUMERIC(7,0) NOT NULL,
    OBJ_DEF_ID VARCHAR(128) NOT NULL,
    REF_DEF_ID VARCHAR(128) NOT NULL,
    OBJ_ID VARCHAR(64) NOT NULL,
    OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL,
    TARGET_OBJ_DEF_ID VARCHAR(128) NOT NULL,
    TARGET_OBJ_ID VARCHAR(64) NOT NULL,
    TARGET_OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL
)
GO

CREATE INDEX OBJ_REF__25_INDEX1 ON OBJ_REF__25 (TENANT_ID, OBJ_DEF_ID, OBJ_ID, REF_DEF_ID)
GO
CREATE INDEX OBJ_REF__25_INDEX2 ON OBJ_REF__25 (TENANT_ID, TARGET_OBJ_DEF_ID, TARGET_OBJ_ID, REF_DEF_ID)
GO

/* drop/create OBJ_REF */
DROP TABLE OBJ_REF__26
GO

CREATE TABLE OBJ_REF__26
(
    TENANT_ID NUMERIC(7,0) NOT NULL,
    OBJ_DEF_ID VARCHAR(128) NOT NULL,
    REF_DEF_ID VARCHAR(128) NOT NULL,
    OBJ_ID VARCHAR(64) NOT NULL,
    OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL,
    TARGET_OBJ_DEF_ID VARCHAR(128) NOT NULL,
    TARGET_OBJ_ID VARCHAR(64) NOT NULL,
    TARGET_OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL
)
GO

CREATE INDEX OBJ_REF__26_INDEX1 ON OBJ_REF__26 (TENANT_ID, OBJ_DEF_ID, OBJ_ID, REF_DEF_ID)
GO
CREATE INDEX OBJ_REF__26_INDEX2 ON OBJ_REF__26 (TENANT_ID, TARGET_OBJ_DEF_ID, TARGET_OBJ_ID, REF_DEF_ID)
GO

/* drop/create OBJ_REF */
DROP TABLE OBJ_REF__27
GO

CREATE TABLE OBJ_REF__27
(
    TENANT_ID NUMERIC(7,0) NOT NULL,
    OBJ_DEF_ID VARCHAR(128) NOT NULL,
    REF_DEF_ID VARCHAR(128) NOT NULL,
    OBJ_ID VARCHAR(64) NOT NULL,
    OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL,
    TARGET_OBJ_DEF_ID VARCHAR(128) NOT NULL,
    TARGET_OBJ_ID VARCHAR(64) NOT NULL,
    TARGET_OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL
)
GO

CREATE INDEX OBJ_REF__27_INDEX1 ON OBJ_REF__27 (TENANT_ID, OBJ_DEF_ID, OBJ_ID, REF_DEF_ID)
GO
CREATE INDEX OBJ_REF__27_INDEX2 ON OBJ_REF__27 (TENANT_ID, TARGET_OBJ_DEF_ID, TARGET_OBJ_ID, REF_DEF_ID)
GO

/* drop/create OBJ_REF */
DROP TABLE OBJ_REF__28
GO

CREATE TABLE OBJ_REF__28
(
    TENANT_ID NUMERIC(7,0) NOT NULL,
    OBJ_DEF_ID VARCHAR(128) NOT NULL,
    REF_DEF_ID VARCHAR(128) NOT NULL,
    OBJ_ID VARCHAR(64) NOT NULL,
    OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL,
    TARGET_OBJ_DEF_ID VARCHAR(128) NOT NULL,
    TARGET_OBJ_ID VARCHAR(64) NOT NULL,
    TARGET_OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL
)
GO

CREATE INDEX OBJ_REF__28_INDEX1 ON OBJ_REF__28 (TENANT_ID, OBJ_DEF_ID, OBJ_ID, REF_DEF_ID)
GO
CREATE INDEX OBJ_REF__28_INDEX2 ON OBJ_REF__28 (TENANT_ID, TARGET_OBJ_DEF_ID, TARGET_OBJ_ID, REF_DEF_ID)
GO

/* drop/create OBJ_REF */
DROP TABLE OBJ_REF__29
GO

CREATE TABLE OBJ_REF__29
(
    TENANT_ID NUMERIC(7,0) NOT NULL,
    OBJ_DEF_ID VARCHAR(128) NOT NULL,
    REF_DEF_ID VARCHAR(128) NOT NULL,
    OBJ_ID VARCHAR(64) NOT NULL,
    OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL,
    TARGET_OBJ_DEF_ID VARCHAR(128) NOT NULL,
    TARGET_OBJ_ID VARCHAR(64) NOT NULL,
    TARGET_OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL
)
GO

CREATE INDEX OBJ_REF__29_INDEX1 ON OBJ_REF__29 (TENANT_ID, OBJ_DEF_ID, OBJ_ID, REF_DEF_ID)
GO
CREATE INDEX OBJ_REF__29_INDEX2 ON OBJ_REF__29 (TENANT_ID, TARGET_OBJ_DEF_ID, TARGET_OBJ_ID, REF_DEF_ID)
GO

/* drop/create OBJ_REF */
DROP TABLE OBJ_REF__30
GO

CREATE TABLE OBJ_REF__30
(
    TENANT_ID NUMERIC(7,0) NOT NULL,
    OBJ_DEF_ID VARCHAR(128) NOT NULL,
    REF_DEF_ID VARCHAR(128) NOT NULL,
    OBJ_ID VARCHAR(64) NOT NULL,
    OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL,
    TARGET_OBJ_DEF_ID VARCHAR(128) NOT NULL,
    TARGET_OBJ_ID VARCHAR(64) NOT NULL,
    TARGET_OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL
)
GO

CREATE INDEX OBJ_REF__30_INDEX1 ON OBJ_REF__30 (TENANT_ID, OBJ_DEF_ID, OBJ_ID, REF_DEF_ID)
GO
CREATE INDEX OBJ_REF__30_INDEX2 ON OBJ_REF__30 (TENANT_ID, TARGET_OBJ_DEF_ID, TARGET_OBJ_ID, REF_DEF_ID)
GO

/* drop/create OBJ_REF */
DROP TABLE OBJ_REF__31
GO

CREATE TABLE OBJ_REF__31
(
    TENANT_ID NUMERIC(7,0) NOT NULL,
    OBJ_DEF_ID VARCHAR(128) NOT NULL,
    REF_DEF_ID VARCHAR(128) NOT NULL,
    OBJ_ID VARCHAR(64) NOT NULL,
    OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL,
    TARGET_OBJ_DEF_ID VARCHAR(128) NOT NULL,
    TARGET_OBJ_ID VARCHAR(64) NOT NULL,
    TARGET_OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL
)
GO

CREATE INDEX OBJ_REF__31_INDEX1 ON OBJ_REF__31 (TENANT_ID, OBJ_DEF_ID, OBJ_ID, REF_DEF_ID)
GO
CREATE INDEX OBJ_REF__31_INDEX2 ON OBJ_REF__31 (TENANT_ID, TARGET_OBJ_DEF_ID, TARGET_OBJ_ID, REF_DEF_ID)
GO

/* drop/create OBJ_REF */
DROP TABLE OBJ_REF__MTP
GO

CREATE TABLE OBJ_REF__MTP
(
    TENANT_ID NUMERIC(7,0) NOT NULL,
    OBJ_DEF_ID VARCHAR(128) NOT NULL,
    REF_DEF_ID VARCHAR(128) NOT NULL,
    OBJ_ID VARCHAR(64) NOT NULL,
    OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL,
    TARGET_OBJ_DEF_ID VARCHAR(128) NOT NULL,
    TARGET_OBJ_ID VARCHAR(64) NOT NULL,
    TARGET_OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL
)
GO

CREATE INDEX OBJ_REF__MTP_INDEX1 ON OBJ_REF__MTP (TENANT_ID, OBJ_DEF_ID, OBJ_ID, REF_DEF_ID)
GO
CREATE INDEX OBJ_REF__MTP_INDEX2 ON OBJ_REF__MTP (TENANT_ID, TARGET_OBJ_DEF_ID, TARGET_OBJ_ID, REF_DEF_ID)
GO

/* drop/create OBJ_REF */
DROP TABLE OBJ_REF__USER
GO

CREATE TABLE OBJ_REF__USER
(
    TENANT_ID NUMERIC(7,0) NOT NULL,
    OBJ_DEF_ID VARCHAR(128) NOT NULL,
    REF_DEF_ID VARCHAR(128) NOT NULL,
    OBJ_ID VARCHAR(64) NOT NULL,
    OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL,
    TARGET_OBJ_DEF_ID VARCHAR(128) NOT NULL,
    TARGET_OBJ_ID VARCHAR(64) NOT NULL,
    TARGET_OBJ_VER NUMERIC(10,0) DEFAULT 0 NOT NULL
)
GO

CREATE INDEX OBJ_REF__USER_INDEX1 ON OBJ_REF__USER (TENANT_ID, OBJ_DEF_ID, OBJ_ID, REF_DEF_ID)
GO
CREATE INDEX OBJ_REF__USER_INDEX2 ON OBJ_REF__USER (TENANT_ID, TARGET_OBJ_DEF_ID, TARGET_OBJ_ID, REF_DEF_ID)
GO
